#define _CRT_SECURE_NO_WARNINGS 1


#include<iostream>

using namespace std;

int main()
{
	int x = 0, y = 0;
	cin >> x >> y;

	int sum = 0;
	for (int i = x; i <= y; i++)
	{
		if (i % 3 == 1 && i % 5 == 3)
		{
			sum += i;
		}
	}

	cout << sum << endl;

	return 0;
}